﻿using StableDiffusionTools.Oobabooga;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LLMEvaluation.Framework
{
    public class GenerationUpdateEventArgs
    {
        public ModelEntry Model { get; set; }
        public RunEntry RunModel { get; set; }
        public List<Message> Messages { get; set; }
        public GenerationUpdateState State { get; set; }
        public int Total { get; set; }
        public int Current { get; set; }

        public GenerationUpdateEventArgs(ModelEntry model, RunEntry run, List<Message> messages, GenerationUpdateState state, int total, int current)
        {
            Model = model;
            RunModel = run;
            Messages = new List<Message>();
            for (int i = 0; i < messages.Count; i++)
            {
                var clonedMessage = new Message(messages[i].Role, messages[i].Content);
                clonedMessage.FixFromApi();
                Messages.Add(clonedMessage);
            }
            State = state;
            Total = total;
            Current = current;
        }
    }

    public enum GenerationUpdateState
    {
        First,
        Middle,
        Last
    }
}
